package com.aaa.doctor.service.impl;

import com.aaa.doctor.dao.PatientFileDao;
import com.aaa.doctor.service.PatientFileService;
import com.aaa.entity.PatientFile;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

/**
 * @version 1.8.0_181
 * @Author ZXJ
 * @Date 2023/3/24 20:14
 * @注释
 */
@Service
public class PatientFileServiceImpl implements PatientFileService {
    @Resource
    private PatientFileDao patientFileDao;

    @Override
    public Result<PatientFile> getByPatientFileId(String patientId) {
        QueryWrapper<PatientFile> wrapper=new QueryWrapper<>();
        if (StringUtils.hasText(patientId)){
            wrapper.eq("patient_Id",patientId);
        }
        PatientFile patientFile = patientFileDao.selectOne(wrapper);
        return new Result<PatientFile>(200,"患者档案查询成功",patientFile);
    }
}
